package com.share.rabbitmq;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;

/**
 * author:caifan
 * date:2019/8/19
 */
public class SendTopic {
    private static final String EXCHANGE_NAME = "topic_language";

    public static void main(String[] args) throws Exception {
        Connection connect = RabbitMQConnect.connect();
        Channel channel = connect.createChannel();

        channel.exchangeDeclare(EXCHANGE_NAME, "topic");
        String routingKey = "java";
        String message = "hello java python";

        channel.basicPublish(EXCHANGE_NAME, routingKey, null , message.getBytes());
    }

}
